package eecs.net.xmpp;
//Class: EECS 285
//Project: 4 (Virtual Markerboard)
//Due Date: Monday December 6th, 2010

import java.util.Map;

/**
 * This interface allows for handling of property key/value pairs extracted from
 * XMPP XML packets received by the incoming connection. Classes that need to
 * receive these notifications must implement this interface, and define the
 * dataReceived() method.
 * 
 * @author Vidal Borromeo
 */
public interface DataListener
{
  public enum CallType {UNDEFINED, DATA_RECEIVED, INCOMING_SEMAPHORE, OUTGOING_SEMAPHORE};
  
  // ---------------------------------------------------------------------------

  /**
   * The client implements this method in order to receive POJO's (Plain Old
   * Java Objects) that were embedded in the incoming packet.
   * 
   * @param properties
   *          A collection of property names mapped to Java Objects. The client
   *          decides what to do with the data.
   * @author Vidal Borromeo
   */
  public void dataReceived(final Map<String, Object> properties);

  // ---------------------------------------------------------------------------

  /**
   * A simple method that allows the client to be aware of when there is an
   * incoming XML packet.
   * 
   * @author Vidal Borromeo
   */
  public void incomingSemaphore();

  // ---------------------------------------------------------------------------

  /**
   * A simple method that allows the client to be aware of when there is an
   * outgoing XML packet.
   * 
   * @author Vidal Borromeo
   */
  public void outgoingSemaphore();

}// DataListener
